<template>
  <div >
   <van-swipe :style='{height}' :autoplay="3000" class="va">
  <van-swipe-item v-for="(image, index) in images" :key="index">
    <img :v-lazy="image"  :src='image'/>
  </van-swipe-item>

</van-swipe>                                               
  
  </div>
</template>

<script>
export default {
  data() {
    return {
        height:'',
      images: [
        '/img/swipe/1.jpg',
       '/img/swipe/2.jpg',
       '/img/swipe/3.jpg',
       
      ],
    };
  },
  mounted(){
    let picWidth = 1242; // 图片宽
    let picHeight = 699; // 图片高
    let screenWidth = window.screen.width; // 屏幕宽
    let swipeHeight = 
        Math.floor((picHeight*screenWidth)/picWidth)+"px";
    this.height = swipeHeight;
  }
};
</script>

<style scoped>

.va img{
  width: 100%;

}
</style>